package com.finalab.yueqiu;

import com.finalab.yueqiu.interceptor.EncodingIntorceptor;
import com.finalab.yueqiu.interceptor.TokenAuthInteceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class YueqiuConfig extends WebMvcConfigurerAdapter {

    @Autowired
    EncodingIntorceptor encodingIntorceptor;
    @Autowired
    TokenAuthInteceptor tokenAuthInteceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(encodingIntorceptor);
        registry.addInterceptor(tokenAuthInteceptor);
    }
}
